import  random
i=1
count = 0
while i<=3:
    print(f'第{i}局')
    y = int(input('请出拳(石头1/剪刀2/布3/退出0):'))
    if y == 0 :
        continue
    random_x = random.randint(1, 3)
    print(f'电脑输入的是{random_x}')
    if (random_x == 1 and y == 2) or (random_x == 2 and y == 3) or (random_x == 3 and y == 1):
        print('电脑胜利，老弟你还得练')
    elif random_x == y:
        print('平局，没输没赢')
    else:
        count+=1
        print(f'你无敌了，孩子！赢的第{count}局')
    i+=1

